From: Florian Müllner Date: Thu, 24 Apr 2014 23:56:31 +0000 (+0200) Subject: workspaceThumbnails: Fix removal of multiple workspaces X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2518 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=05ddece9a0b966e61d4952813d8ce008e11554e6;p=gnome-shell.git workspaceThumbnails: Fix removal of multiple workspaces When workspaces have been removed, we need to remove the corresponding thumbnails as well; the number of thumbnails that need removing is the difference between the old number of workspaces and the new one. Currently we assume that the old number of workspaces corresponds to the number of existing thumbnails, but that may actually be wrong: A thumbnail will still be animated out after its workspace has been removed. As a result, we end up removing too many thumbnails when a workspace is removed while a thumbnail of a previously removed workspace is still animating out. Fix this by basing the old number of workspaces only on thumbnails that have not been removed previously. https://bugzilla.gnome.org/show_bug.cgi?id=728820 --- diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 113f2a71b..1eb843dc9 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -903,7 +903,10 @@ const ThumbnailsBox = new Lang.Class({ }, _workspacesChanged: function() { - let oldNumWorkspaces = this._thumbnails.length; + let validThumbnails = this._thumbnails.filter(function(t) { + return t.state <= ThumbnailState.NORMAL; + }); + let oldNumWorkspaces = validThumbnails.length; let newNumWorkspaces = global.screen.n_workspaces; let active = global.screen.get_active_workspace_index();